package wordroid.activitys;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TabHost;
import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import wordroid.database.DataAccess;
import wordroid.model.BookList;
import wordroid.model.WordList;

public class study extends TabActivity
  implements TabHost.TabContentFactory
{
  String info = "hey";
  private ArrayList<String> listShould;
  public ArrayList<WordList> wordlist;

  private List<Map<String, Object>> getData(String paramString)
  {
    ArrayList localArrayList = new ArrayList();
    int j;
    if (paramString.equals("studid"))
    {
      j = 0;
      label20: if (j < this.wordlist.size());
    }
    int i;
    do
    {
      do
      {
        return localArrayList;
      /*  if (((WordList)this.wordlist.get(j)).getLearned().equals("0"))
        {
          HashMap localHashMap3 = new HashMap();
          localHashMap3.put("label", " LIST-" + ((WordList)this.wordlist.get(j)).getList());
          localHashMap3.put("image", Integer.valueOf(17301516));
          localArrayList.add(localHashMap3);
        }
        ++j;*/
       // break label20:
      }
      while (!(paramString.equals("all")));
     // label147: i = 0;
    }
    while (i >= this.wordlist.size());
/*    if (((WordList)this.wordlist.get(i)).getLearned().equals("0"))
    {
      HashMap localHashMap1 = new HashMap();
      localHashMap1.put("label", " LIST-" + ((WordList)this.wordlist.get(i)).getList());
      localHashMap1.put("status", "未学习");
      localHashMap1.put("image", Integer.valueOf(17301516));
      localArrayList.add(localHashMap1);
    }*/
    /*while (true)
    {
      ++i;
      break label147:
      if (!(((WordList)this.wordlist.get(i)).getLearned().equals("1")))
        continue;
      HashMap localHashMap2 = new HashMap();
      localHashMap2.put("label", " LIST-" + ((WordList)this.wordlist.get(i)).getList());
      localHashMap2.put("status", "已学习");
      localHashMap2.put("image", Integer.valueOf(17301515));
      localArrayList.add(localHashMap2);
    }*/
  }

  private void startStudy(int paramInt1, int paramInt2, int paramInt3)
  {
    if (paramInt2 == 2)
      if (paramInt3 == 1)
        new AlertDialog.Builder(this).setIcon(2130837509).setTitle("提示").setMessage("此单元已学过，重新学习将清除学习进度，是否继续？\nLIST-" + (paramInt1 + 1)).setPositiveButton("确定",/* new  (this, paramInt1)*/null).setNeutralButton("取消",null/* new 5(this)*/).create().show();
    while (true)
    {
     
      new AlertDialog.Builder(this).setIcon(2130837509).setTitle("开始学习：").setMessage("LIST-" + (paramInt1 + 1)).setPositiveButton("确定", null/*new 6(this, paramInt1)*/).setNeutralButton("取消", /*new 7(this)*/null).create().show();
      continue;
   /*   if (paramInt2 != 1)
        continue;*/
    //  new AlertDialog.Builder(this).setIcon(2130837509).setTitle("开始学习：").setMessage("LIST-" + ((String)this.listShould.get(paramInt1))).setPositiveButton("确定", /*new 8(this, paramInt1)*/null).setNeutralButton("取消", /*new 9(this)*/null).create().show();
    //  return;
    }
  }

  public View createTabContent(String paramString)
  {
    ListView localListView = new ListView(this);
    LinearLayout localLinearLayout = new LinearLayout(this);
    localLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
    localLinearLayout.setBackgroundDrawable(getResources().getDrawable(2130837519));
    localLinearLayout.setOrientation(1);
    TextView localTextView = new TextView(this);
    localTextView.setTextColor(-16777216);
    localTextView.setBackgroundDrawable(getResources().getDrawable(2130837520));
    localLinearLayout.addView(localTextView);
    localLinearLayout.addView(localListView);
    localListView.setCacheColorHint(0);
    List localList1 = getData(paramString);
    String[] arrayOfString1 = new String[3];
    arrayOfString1[0] = "label";
    arrayOfString1[1] = "status";
    arrayOfString1[2] = "image";
    int[] arrayOfInt1 = new int[3];
    arrayOfInt1[0] = 2131165200;
    arrayOfInt1[1] = 2131165211;
    arrayOfInt1[2] = 2131165210;
    SimpleAdapter localSimpleAdapter1 = new SimpleAdapter(this, localList1, 2130903050, arrayOfString1, arrayOfInt1);
    List localList2 = getData(paramString);
    String[] arrayOfString2 = new String[2];
    arrayOfString2[0] = "label";
    arrayOfString2[1] = "image";
    int[] arrayOfInt2 = new int[2];
    arrayOfInt2[0] = 2131165200;
    arrayOfInt2[1] = 2131165209;
    SimpleAdapter localSimpleAdapter2 = new SimpleAdapter(this, localList2, 2130903049, arrayOfString2, arrayOfInt2);
    if (paramString.equals("all"))
    {
      localTextView.setText("    所有的LIST");
      localListView.addHeaderView(LayoutInflater.from(this).inflate(2130903043, null));
      localListView.setAdapter(localSimpleAdapter1);
      localListView.setOnItemClickListener(/*new 1(this)*/null);
    }
    while (true)
    {
      
      if (!(paramString.equals("studid")))
        continue;
      localTextView.setText("    未学习过的LIST");
      localListView.addHeaderView(LayoutInflater.from(this).inflate(2130903043, null));
      localListView.setAdapter(localSimpleAdapter2);
      localListView.setOnItemClickListener(/*new 2(this)*/null);
      localListView.setOnItemLongClickListener(/*new 3(this)*/null);
      return localLinearLayout;
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    TabHost localTabHost = getTabHost();
    DataAccess localDataAccess = new DataAccess(this);
    this.wordlist = localDataAccess.QueryList("BOOKID ='" + DataAccess.bookID + "'", null);
    this.listShould = new ArrayList(this.wordlist.size());
    for (int i = 0; ; ++i)
    {
      if (i >= this.wordlist.size())
      {
        BookList localBookList = (BookList)localDataAccess.QueryBook("ID ='" + DataAccess.bookID + "'", null).get(0);
        setTitle("学习-" + localBookList.getName());
        LayoutInflater.from(this).inflate(2130903056, localTabHost.getTabContentView(), true);
        localTabHost.addTab(localTabHost.newTabSpec("studid").setIndicator("未学过的LIST", getResources().getDrawable(2130837535)).setContent(this));
        localTabHost.addTab(localTabHost.newTabSpec("all").setIndicator("所有的LIST", getResources().getDrawable(2130837504)).setContent(this));
        return;
      }
      if (!(((WordList)this.wordlist.get(i)).getLearned().equals("0")))
        continue;
      this.listShould.add(((WordList)this.wordlist.get(i)).getList());
    }
  }
}

/* Location:           E:\Desktop\Android\英语词汇记忆\classes_dex2jar.jar
 * Qualified Name:     wordroid.activitys.study
 * JD-Core Version:    0.5.3
 */